/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Administrateur
 */
@Entity
@Table(name = "relation_types")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "RelationTypes.findAll", query = "SELECT r FROM RelationTypes r"),
    @NamedQuery(name = "RelationTypes.findById", query = "SELECT r FROM RelationTypes r WHERE r.id = :id"),
    @NamedQuery(name = "RelationTypes.findByIdGen", query = "SELECT r FROM RelationTypes r WHERE r.idGen = :idGen"),
    @NamedQuery(name = "RelationTypes.findByIdSpec", query = "SELECT r FROM RelationTypes r WHERE r.idSpec = :idSpec")})
public class RelationTypes implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_gen")
    private int idGen;
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_spec")
    private int idSpec;

    public RelationTypes() {
    }

    public RelationTypes(Integer id) {
        this.id = id;
    }

    public RelationTypes(Integer id, int idGen, int idSpec) {
        this.id = id;
        this.idGen = idGen;
        this.idSpec = idSpec;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getIdGen() {
        return idGen;
    }

    public void setIdGen(int idGen) {
        this.idGen = idGen;
    }

    public int getIdSpec() {
        return idSpec;
    }

    public void setIdSpec(int idSpec) {
        this.idSpec = idSpec;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof RelationTypes)) {
            return false;
        }
        RelationTypes other = (RelationTypes) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.RelationTypes[ id=" + id + " ]";
    }
    
}
